<template>
    <div v-for="item in searchApiData">
        <!-- <router-link :to="{name:'dd',params:{item:goods_id.goods}}"> -->
<van-card
  :price="item.goods_name"
  :title="item.goods_name"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<van-card
  num="2"
  price="2.00"
  desc="描述信息"
  title="商品标题"
  thumb="https://fastly.jsdelivr.net/npm/@vant/assets/ipad.jpeg"
  @click="cc"
/>
<!-- </router-link> -->
    </div>
</template>

<script setup>
import router from '@/router';
import { ref } from 'vue';
import { useRoute } from 'vue-router';
let route=useRoute()
import { searchApi } from '@/api/api';
let searchApiData=ref([])
console.log(route.params.query);
searchApi().then(res=>{
    searchApiData.value=res.data.message
    console.log(res.data.message);
    
})
const cc=()=>{
    router.push('/dd/:goods_id')
}
</script>

<style lang="scss" scoped>

</style>